const Sequelize = require('sequelize');
const baseModel = require('../baseModel');

class orgInfoModel extends baseModel{
  constructor(){
    super('org_info',{
      id:{
        type: Sequelize.INTEGER,
        autoIncrement: true,
        allowNull: false,
        primaryKey:true
      },
      name: {
        type: Sequelize.STRING(20),
        allowNull: false
      },
      domain: {
        type: Sequelize.STRING(20),
        primaryKey:true,
        allowNull: false
      },
      icon:{
        type: Sequelize.STRING,
        allowNull: false
      },
      logo:{
        type: Sequelize.STRING,
        allowNull: false
      },
      expiration: {
        type: Sequelize.DATE,
        allowNull: false
      },
      createdAt: {
        type: Sequelize.DATE,
        allowNull: false
      }
    });
    this.model = super.getModel();
    this.model.sync();
  }
}

module.exports = new orgInfoModel();
